﻿<%@ Page Language="C#" MasterPageFile="~/MyMasterPage.master" AutoEventWireup="true" CodeFile="LinkDirectory.aspx.cs" Inherits="pages_LinkDirectory" Title="Untitled Page" %>

<%@ Register assembly="System.Web.Silverlight" namespace="System.Web.UI.SilverlightControls" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="total" style="text-align: justify">
    <asp:DataList ID="DataList1" runat="server" DataKeyField="id" 
        DataSourceID="SqlDataSource1">
        <ItemTemplate>
               <h2><asp:Label ID="titleLabel" runat="server" Text='<%# Eval("title") %>' /></h2>
               <h3></h3>
               <div class="padding" style="text-align: justify">
                    <asp:Label ID="descLabel" runat="server" Text='<%# Eval("linkdesc") %>' />
                   
              </div>                         
              <p class="date">
                Last Updatet: <asp:Label ID="dateLabel" runat="server" Text='<%# Eval("date") %>' />
              </p>
            
        </ItemTemplate>
    </asp:DataList>
    
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Personal %>" 
        DeleteCommand="DELETE FROM [LinkStore] WHERE [id] = @id" 
        InsertCommand="INSERT INTO [LinkStore] ([title], [linkdesc], [date]) VALUES (@title, @linkdesc, @date)" 
        SelectCommand="SELECT * FROM [LinkStore]" 
        UpdateCommand="UPDATE [LinkStore] SET [title] = @title, [linkdesc] = @linkdesc, [date] = @date WHERE [id] = @id">
        <DeleteParameters>
            <asp:Parameter Name="id" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="title" Type="String" />
            <asp:Parameter Name="linkdesc" Type="String" />
            <asp:Parameter Name="date" Type="Object" />
            <asp:Parameter Name="id" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="title" Type="String" />
            <asp:Parameter Name="linkdesc" Type="String" />
            <asp:Parameter Name="date" Type="Object" />
        </InsertParameters>
    </asp:SqlDataSource>
    <br />
   </div>
</asp:Content>

